<?php

/**
 * Description of G_XmlConfigs
 * @author 耿鸿飞<eoe2005@qq.com>
 */
class G_XmlConfig extends GC_Config {

    protected $_doc;

    public function __construct($filepath) {
        $this->_doc = simplexml_load_file($filepath);
        if($this->_doc){
            
        }else{
            trigger_error("读取配置文件失败");
            die();
        }
    }

    public function getItem($key) {
        $key = '/'.str_replace(".", '/', $key);
        $rs = $this->_doc->xpath($key);
        if($rs == FALSE){
            return null;
        }
        while(list( , $node) = each($result)) {
            return $node;
        }
    }

}

?>
